1. Field of the Invention
The present invention generally relates to a method and an apparatus for detecting a position of an object and its angle to a specific reference and, more particularly, it relates to a method and an apparatus that precisely detects a position and its angle of a tool used in computer games.
2. Description of the Background Art
Sports computer games directed to baseball, football, golf, tennis, table tennis, bowling, and so on form one of the categories of computer games. Most of these sports games require associated tools for playing. A bat for baseball, a racket for tennis or table tennis, a bowling ball for bowling, to name a few. A game program running on a CPU (Central Processing Unit) of a game apparatus creates a virtual game situation where a user is supposed to be a player, generates a video image of surroundings, and shows the image on a television set (TV). When a specific situation arises, the player is requested to take an action using the tool. In response to the player's action, the game program changes the virtual situation, and the player is requested to take a next action.
Take a golf game as an example. At the start of the game, a golf game program creates a scene of a teeing ground. A green can be seen on a backside of the teeing ground and a virtual golf ball is placed at the center (or any other place) of the teeing ground. Then, the player “addresses” an image sensor unit placed on a floor and tries to hit the virtual ball with a club, i.e., swings the club above the image sensor unit.
When the player swings the club, the image sensor picks up an image of the moving club head. The image of the club head is applied to the golf game program. In response, the golf game program computes the position of the club head on the basis of the image, computes the direction and the speed of the club head on the basis of the position, computes the resultant trajectory of the imaginary golf ball hit by the imaginary golf club in accordance with the direction and the speed of the club head, and creates a new game situation in accordance with the new position of the golf ball.
Naturally, specific hardware is necessary for detecting the position of the club head. Japanese Patent Application Laying-Open (Tokkai) No. 2004-85524 discloses an apparatus for detecting such positions of a game tool. The apparatus is used in a computer golf game and includes a stroboscope having four LED's (light emitting diodes), a CMOS (Complementary Metal-Oxide-Silicon) image sensor (hereinafter “CIS”), and a processor. A reflector is attached to the bottom (sole) of a club head or a putter head. The reflector has a long rectangular shape with circular ends. The apparatus is connected to a TV monitor and a golf game program running on the processor generates the video image of a virtual golf course in response to player's action with the club or the putter.
In operation, the CIS captures two kinds of images: images during the stroboscope LED's are on (emitting light); and images during the stroboscope LED's are off. The image signals are applied to the processor, where necessary computation is carried out.
When LED's are emitting light, the reflector reflects that light to the CIS; therefore, the CMOS sensor forms the image of the reflector. Other light sources also form images on the CIS. When the LED's are off, the reflector does not reflect the light; the image is not formed. Only other light sources form their images. By computing the difference between these two kinds of images in the processor, therefore, the processor can detect the image of the reflector separate from other images.
The processor detects two points farthest from each other in the image of the reflector. These two points indicate the two ends of the mid line of the reflector; by knowing the X and Y coordinates of these points, the processor can know the position of the club head or the putter head as an average of these two points. By computing the average of these two points for each of the captured images, the processor computes the direction and the speed of the movement of the club head. Also, the processor can compute the angle θ between the line connecting the two end points of the reflector and a prescribed reference line. From this angle θ, the angle of the clubface can be computed.
The golf game program running on the processor processes these data, determines the trajectory of the virtual golf ball, and creates next virtual situation.
However, in order to determine the two farthest points in the image of the reflector, the processor have to compute the distance of each combination of two points in the image of the reflector. This is relatively complicated operation and requires a considerable amount of computing time. Further, the CIS has a 32×32 pixel, 8 bits per pixel image plane. The data size of one image therefore amounts to 8192 bits=1024 bytes. The processor needs to receive the data from the CIS, store the data, and carry out the above-described computations on the stored data.
Therefore, a processor with relatively high performance is necessary in order to carry out the computations necessary for the game in real time. Also, the processor needs to have storage with a capacity large enough to store the data output from the CIS. This results in a computer game machine with a relatively high cost. Because younger people are the main users of the computer game machines, the game machines should be inexpensive although they should have enough performance to fully operate in real time.
Further, because it is basic demands that the game machine responses to the operation of the user, the image of the reflector should be precisely detected.